package com.nowcoder;

import java.util.Scanner;

/**
 * 字符串最后一个单词的长度
 * 计算字符串最后一个单词的长度，单词以空格隔开，字符串长度小于5000
 */
public class LastWordLength {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String source = in.nextLine();
        String[] target = source.split(" ");
        int size = target.length;
        System.out.println(target[size -1].length());
    }
}
